package com.mt.roll.wms.controller;

import com.mt.roll.core.base.BaseController;
import com.mt.roll.core.constants.CommonConstant;
import com.mt.roll.core.validator.groups.UpdateGroup;
import com.mt.roll.core.vo.IdVo;
import com.mt.roll.core.vo.R;
import com.mt.roll.wms.params.CallBackParam;
import com.mt.roll.wms.service.CarTaskExecutionInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.groups.Default;

/**
 * @Author weihongyang
 * @Date 2021/12/6 3:44 下午
 * @Version 1.0
 */
@RestController
@RequestMapping(CommonConstant.API_MODULE_WMS + "call/back")
@Slf4j
@Api(value = "回调接口", tags = "回调接口", hidden = false)
public class CallBackController extends BaseController {


    @Autowired
    private CarTaskExecutionInfoService carTaskExecutionInfoService;

    /**
     * RGV结束任务回调接口
     * @param callBackParam
     * @return
     */
    @PostMapping(value = "rgv/task/end")
    @ApiOperation(value = "更新")
    private R<IdVo> rgvTaskEnd(@Validated({UpdateGroup.class, Default.class}) @RequestBody CallBackParam callBackParam) {
        return carTaskExecutionInfoService.rgvTaskEnd(callBackParam);
    }

}
